exports.removeActionPermissions = function (req, res) {

    //获取参数信息
    var bodyParams = req.routeInfo.bodyParams;

    //任务流创建
    async.waterfall([

        //判断该原子层接口是否有关联的菜单
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.menuActionPermissionsMiddleSearch.Request_Api_Url + "/mapm_apid/" + bodyParams.apid,
                    method : 'GET'
                },
                function (data) {

                    if(data.result.data.length > 0){
                        return RES.errorResponse(res,"抱歉，该接口有关联的菜单，请先删除关联，在删除该接口");
                    }

                    cb()
                
                }
            )
        },

        //删除接口信息
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.systemApiDeleteActionPermissions.Request_Api_Url,
                    method : 'POST',
                    data : {
                        ap_id : bodyParams.apid
                    }
                },
                function (data) {

                    cb()
                
                }
            )
        }
      
    ],()=>{

        //返回最终拼接结果
        RES.successResponse(res);

    });

}